package com.tyron.globalexception.controller;

import com.tyron.globalexception.exception.CustomException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class TestController {

    @GetMapping("/exception")
    public String exceptionTest() {
        // 抛出自定义异常
        throw new CustomException("This is a custom exception");
    }
}
